module.exports = app => {
    const { router, controller } = app;
    router.post('/login', controller.user.login);
    router.post('/register', controller.user.register);

    // 获取商品列表
    router.get('/shop/list', controller.shop.getList)
    // 获取商品详情
    router.get('/shop/detail/:id',controller.shop.getDetail)

    // 加入购物车
    router.post('/cart/add', app.middleware.auth(), controller.cart.addToCart)
    // 购物车商品数量+-
    router.put('/cart/count', controller.cart.setCartCount)
    // 获取购物车列表
    router.get('/cart/list', controller.cart.getCartList)
    // 删除购物车数据
    router.delete('/cart/list/:id', controller.cart.delCartList)
  };

  